﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class MovsalFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As MovsalBE
        Dim tmpMovsal As MovsalBE = New MovsalBE()
        Try
            With tmpMovsal
                .Cantidad = convertDTFromDb.ConvertDecimal(dr.Item("Cantidad"))
                .ClaProducto = convertDTFromDb.ConvertString(dr.Item("ClaProduto"))
                .Costo = convertDTFromDb.ConvertDecimal(dr.Item("Costo"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                .Estado = convertDTFromDb.ConvertString(dr.Item("Estado"))
                .FecComSal = convertDTFromDb.convertDateTime(dr.Item("FecComSal"))
                .FecSal = convertDTFromDb.convertDateTime(dr.Item("FecSal"))
                .Id = convertDTFromDb.convertInt32(dr.Item("Id"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .NumCuenta = convertDTFromDb.ConvertString(dr.Item("NumCuenta"))
                .NumSal = convertDTFromDb.convertInt32(dr.Item("NumSal"))
                .Partida = convertDTFromDb.convertInt32(dr.Item("Partida"))
                .Precio = convertDTFromDb.ConvertDecimal(dr.Item("Precio"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .TipoCamb = convertDTFromDb.ConvertDecimal(dr.Item("TipoCamb"))
                .UniMed = convertDTFromDb.ConvertString(dr.Item("UniMed"))
            End With
            Return tmpMovsal
        Catch ex As Exception
            Throw
        Finally
            tmpMovsal = Nothing
        End Try
    End Function
End Class
